%%
%% cuartilla.cls - Clase de LaTeX2e para el formato tradicional de cuartillas
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{cuartilla}[2004/04/11 v1.0 Estilo Tradicional de Cuartillas]

\newif\if@isdraft

\DeclareOption{draft}{ \@isdrafttrue  \PassOptionsToClass{draft}{article} }
\DeclareOption{final}{ \@isdraftfalse \PassOptionsToClass{final}{article} }
\DeclareOption{openbib}{ \PassOptionsToClass{openbib}{article} }
% \DeclareOption{letterpaper}{ \PassOptionToClass{letterpaper}{article} }
% \DeclareOption{a4paper}{ \PassOptionToClass{a4paper}{article} }

\ExecuteOptions{final}
\ProcessOptions
\LoadClass[a4paper,oneside,onecolumn,12pt]{article}[1996/10/31]

% double & singlespacing %
\def\setspace@size{\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi}
\def\doublespacing{\def\baselinestretch{1.7} \setspace@size}
\def\singlespacing{\def\baselinestretch{1} \setspace@size}

\newenvironment{singlespace}{\vskip\baselineskip\singlespacing\vskip-\baselineskip}%
  {\par}
\newenvironment{doublespace}{\vskip\baselineskip\doublespacing\vskip-\baselineskip}%
  {\par}

% floats & footnotes singlespaced %
\let\latexx@xfloat=\@xfloat
\def\@xfloat #1[#2]{\latexx@xfloat #1[#2]
  \def\baselinestretch{1}\@normalsize\normalsize}
\long\def\@footnotetext#1{
  \insert\footins{
    \def\baselinestretch{1}
    \reset@font\footnotesize
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
    \protected@edef\@currentlabel{
      \csname p@footnote\endcsname\@thefnmark}
    \color@begingroup \@makefntext{
        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}
    \color@endgroup}}
\long\def\@mpfootnotetext#1{
  \global\setbox\@mpfootins\vbox{
    \unvbox \@mpfootins
    \def\baselinestretch {1}
    \reset@font\footnotesize
    \hsize\columnwidth \@parboxrestore
    \protected@edef\@currentlabel{
      \csname p@mpfootnote\endcsname\@thefnmark}
    \color@begingroup \@makefntext{
       \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}
   \color@endgroup}}

\newcommand*{\@normalsize}{\normalsize}
\doublespacing

% page margins %
\setlength{\oddsidemargin}{3cm}
\addtolength{\oddsidemargin}{-1in}
\setlength{\evensidemargin}{\oddsidemargin}

\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-6cm}

\setlength{\topmargin}{1.5cm}
\addtolength{\topmargin}{-1in}

\setlength{\headsep}{1cm}
\addtolength{\headsep}{-\headheight}

\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-5cm}

\setlength{\footskip}{1cm}

% title
\def\@maketitle{%
  \newpage
  \null
  \vskip 1em%
  \begin{center}%
  \let \footnote \thanks
    {\LARGE \@title \par}%
    \vskip 0.5em%
    {\large
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 0.2em%
    {\large \@date}%
  \end{center}%
  \par}

% draft overfull rule %
\AtBeginDocument{
  \if@isdraft\setlength\overfullrule{5pt}\fi
}

\endinput
%%
%% End of file `cuartilla.cls'.
